package com.weilai.lzt.sms3.service;

import android.app.Service;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.IBinder;
import android.util.Log;
import com.weilai.lzt.sms3.Sms2Receiver;

public class RegisterService extends Service {
    private Sms2Receiver sms2Receiver;
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        //1.创建广播接收者对象
        sms2Receiver = new Sms2Receiver();
        //2.创建intent-filter对象
        IntentFilter filter = new IntentFilter();
        filter.addAction(Intent.ACTION_SCREEN_OFF);
        filter.addAction(Intent.ACTION_SCREEN_ON);
        //3.注册广播接收者
        registerReceiver(sms2Receiver, filter);

        Log.i("lzt","RegisterService.onCreate启动了");
    }


}
